3.679 \(\int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^3 \, dx\)

Optimal. Leaf size=99 \[ -\frac {a^2 c^3 (3 B+i A) (1-i \tan (e+f x))^4}{4 f}+\frac {2 a^2 c^3 (B+i A) (1-i \tan (e+f x))^3}{3 f}+\frac {a^2 B c^3 (1-i \tan (e+f x))^5}{5 f} \]

[Out]

2/3*a^2*(I*A+B)*c^3*(1-I*tan(f*x+e))^3/f-1/4*a^2*(I*A+3*B)*c^3*(1-I*tan(f*x+e))^4/f+1/5*a^2*B*c^3*(1-I*tan(f*x
+e))^5/f

________________________________________________________________________________________

Rubi [A]  time = 0.15, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3588, 77} \[ -\frac {a^2 c^3 (3 B+i A) (1-i \tan (e+f x))^4}{4 f}+\frac {2 a^2 c^3 (B+i A) (1-i \tan (e+f x))^3}{3 f}+\frac {a^2 B c^3 (1-i \tan (e+f x))^5}{5 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^2*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^3,x]

[Out]

(2*a^2*(I*A + B)*c^3*(1 - I*Tan[e + f*x])^3)/(3*f) - (a^2*(I*A + 3*B)*c^3*(1 - I*Tan[e + f*x])^4)/(4*f) + (a^2
*B*c^3*(1 - I*Tan[e + f*x])^5)/(5*f)

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^2 (A+B \tan (e+f x)) (c-i c \tan (e+f x))^3 \, dx &=\frac {(a c) \operatorname {Subst}\left (\int (a+i a x) (A+B x) (c-i c x)^2 \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (2 a (A-i B) (c-i c x)^2-\frac {a (A-3 i B) (c-i c x)^3}{c}-\frac {i a B (c-i c x)^4}{c^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {2 a^2 (i A+B) c^3 (1-i \tan (e+f x))^3}{3 f}-\frac {a^2 (i A+3 B) c^3 (1-i \tan (e+f x))^4}{4 f}+\frac {a^2 B c^3 (1-i \tan (e+f x))^5}{5 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 6.34, size = 146, normalized size = 1.47 \[ \frac {a^2 c^3 \sec (e) \sec ^5(e+f x) (15 (B-i A) \cos (2 e+f x)+15 (B-i A) \cos (f x)-15 A \sin (2 e+f x)+25 A \sin (2 e+3 f x)+5 A \sin (4 e+5 f x)+35 A \sin (f x)-15 i B \sin (2 e+f x)+5 i B \sin (2 e+3 f x)+i B \sin (4 e+5 f x)-5 i B \sin (f x))}{120 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^2*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x])^3,x]

[Out]

(a^2*c^3*Sec[e]*Sec[e + f*x]^5*(15*((-I)*A + B)*Cos[f*x] + 15*((-I)*A + B)*Cos[2*e + f*x] + 35*A*Sin[f*x] - (5
*I)*B*Sin[f*x] - 15*A*Sin[2*e + f*x] - (15*I)*B*Sin[2*e + f*x] + 25*A*Sin[2*e + 3*f*x] + (5*I)*B*Sin[2*e + 3*f
*x] + 5*A*Sin[4*e + 5*f*x] + I*B*Sin[4*e + 5*f*x]))/(120*f)

________________________________________________________________________________________

fricas [A]  time = 1.30, size = 126, normalized size = 1.27 \[ \frac {{\left (80 i \, A + 80 \, B\right )} a^{2} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (100 i \, A - 20 \, B\right )} a^{2} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (20 i \, A - 4 \, B\right )} a^{2} c^{3}}{15 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/15*((80*I*A + 80*B)*a^2*c^3*e^(4*I*f*x + 4*I*e) + (100*I*A - 20*B)*a^2*c^3*e^(2*I*f*x + 2*I*e) + (20*I*A - 4
*B)*a^2*c^3)/(f*e^(10*I*f*x + 10*I*e) + 5*f*e^(8*I*f*x + 8*I*e) + 10*f*e^(6*I*f*x + 6*I*e) + 10*f*e^(4*I*f*x +
 4*I*e) + 5*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

giac [A]  time = 2.25, size = 165, normalized size = 1.67 \[ \frac {80 i \, A a^{2} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 80 \, B a^{2} c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 100 i \, A a^{2} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 20 \, B a^{2} c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 20 i \, A a^{2} c^{3} - 4 \, B a^{2} c^{3}}{15 \, {\left (f e^{\left (10 i \, f x + 10 i \, e\right )} + 5 \, f e^{\left (8 i \, f x + 8 i \, e\right )} + 10 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 10 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 5 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/15*(80*I*A*a^2*c^3*e^(4*I*f*x + 4*I*e) + 80*B*a^2*c^3*e^(4*I*f*x + 4*I*e) + 100*I*A*a^2*c^3*e^(2*I*f*x + 2*I
*e) - 20*B*a^2*c^3*e^(2*I*f*x + 2*I*e) + 20*I*A*a^2*c^3 - 4*B*a^2*c^3)/(f*e^(10*I*f*x + 10*I*e) + 5*f*e^(8*I*f
*x + 8*I*e) + 10*f*e^(6*I*f*x + 6*I*e) + 10*f*e^(4*I*f*x + 4*I*e) + 5*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 101, normalized size = 1.02 \[ \frac {c^{3} a^{2} \left (-\frac {i B \left (\tan ^{5}\left (f x +e \right )\right )}{5}-\frac {i A \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {A \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x)

[Out]

1/f*c^3*a^2*(-1/5*I*B*tan(f*x+e)^5-1/4*I*A*tan(f*x+e)^4-1/3*I*B*tan(f*x+e)^3+1/4*B*tan(f*x+e)^4-1/2*I*A*tan(f*
x+e)^2+1/3*A*tan(f*x+e)^3+1/2*B*tan(f*x+e)^2+A*tan(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 1.62, size = 103, normalized size = 1.04 \[ -\frac {12 i \, B a^{2} c^{3} \tan \left (f x + e\right )^{5} + {\left (15 i \, A - 15 \, B\right )} a^{2} c^{3} \tan \left (f x + e\right )^{4} - 20 \, {\left (A - i \, B\right )} a^{2} c^{3} \tan \left (f x + e\right )^{3} + {\left (30 i \, A - 30 \, B\right )} a^{2} c^{3} \tan \left (f x + e\right )^{2} - 60 \, A a^{2} c^{3} \tan \left (f x + e\right )}{60 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

-1/60*(12*I*B*a^2*c^3*tan(f*x + e)^5 + (15*I*A - 15*B)*a^2*c^3*tan(f*x + e)^4 - 20*(A - I*B)*a^2*c^3*tan(f*x +
 e)^3 + (30*I*A - 30*B)*a^2*c^3*tan(f*x + e)^2 - 60*A*a^2*c^3*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 9.02, size = 108, normalized size = 1.09 \[ -\frac {-A\,a^2\,c^3\,\mathrm {tan}\left (e+f\,x\right )+\frac {a^2\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {a^2\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}+\frac {a^2\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (A+B\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4}+\frac {B\,a^2\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^5\,1{}\mathrm {i}}{5}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)^2*(c - c*tan(e + f*x)*1i)^3,x)

[Out]

-((a^2*c^3*tan(e + f*x)^2*(A + B*1i)*1i)/2 - A*a^2*c^3*tan(e + f*x) + (a^2*c^3*tan(e + f*x)^3*(A*1i + B)*1i)/3
 + (a^2*c^3*tan(e + f*x)^4*(A + B*1i)*1i)/4 + (B*a^2*c^3*tan(e + f*x)^5*1i)/5)/f

________________________________________________________________________________________

sympy [B]  time = 0.87, size = 218, normalized size = 2.20 \[ \frac {20 A a^{2} c^{3} + 4 i B a^{2} c^{3} + \left (100 A a^{2} c^{3} e^{2 i e} + 20 i B a^{2} c^{3} e^{2 i e}\right ) e^{2 i f x} + \left (80 A a^{2} c^{3} e^{4 i e} - 80 i B a^{2} c^{3} e^{4 i e}\right ) e^{4 i f x}}{- 15 i f e^{10 i e} e^{10 i f x} - 75 i f e^{8 i e} e^{8 i f x} - 150 i f e^{6 i e} e^{6 i f x} - 150 i f e^{4 i e} e^{4 i f x} - 75 i f e^{2 i e} e^{2 i f x} - 15 i f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**2*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e))**3,x)

[Out]

(20*A*a**2*c**3 + 4*I*B*a**2*c**3 + (100*A*a**2*c**3*exp(2*I*e) + 20*I*B*a**2*c**3*exp(2*I*e))*exp(2*I*f*x) +
(80*A*a**2*c**3*exp(4*I*e) - 80*I*B*a**2*c**3*exp(4*I*e))*exp(4*I*f*x))/(-15*I*f*exp(10*I*e)*exp(10*I*f*x) - 7
5*I*f*exp(8*I*e)*exp(8*I*f*x) - 150*I*f*exp(6*I*e)*exp(6*I*f*x) - 150*I*f*exp(4*I*e)*exp(4*I*f*x) - 75*I*f*exp
(2*I*e)*exp(2*I*f*x) - 15*I*f)

________________________________________________________________________________________